﻿using System;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Defines an HTML canvas.
    /// </summary>
    [Serializable]
    public class Canvas : Element {
        private int? _width;
        private int? _height;

        /// <summary>
        /// Gets the height of this canvas.
        /// </summary>
        public int? Height {
            get { return _height; }
            set { _height = value; }
        }

        /// <summary>
        /// Gets the width of this canvas.
        /// </summary>
        public int? Width {
            get { return _width; }
            set { _width = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _height, "height");
            AttributeWriter.Write(sb, _width, "width");
        }
    }
}
